#include "Globals.hpp"

// This method sleeps so that one can attach and debug.
void Globals::debug() {
    // So that we can attach & debug.
    int i = 0;
    char hostname[256];
    gethostname(hostname, sizeof(hostname));
    printf("PID %d on %s ready for attach\n", getpid(), hostname);
    // I'm not sure why this doesn't work but it doesn't. -tayfun
    // Somehow both nodes receive something from the console.
    // cin >> i;
    // It does not work because what you press is sent to the proc. with
    // rank = 0 only and not to others.

    // Sleep for 5 seconds until i is set to something else through debugger.
    while (0 == i)
        sleep(5);
}

// One must define all the static variables outside the class.
int Globals::rank, Globals::size, Globals::totalTransactions, 
    Globals::minimumSupport, Globals::pruneMethod, Globals::reduceBroadcast,
    Globals::dataType;
bool Globals::verbose;
string Globals::inputFileName, Globals::outputFileName;

